package com.ruoyi.aitafk.service;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.aitcommon.anotation.ServiceLog;
import com.ruoyi.aitcommon.service.SQLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;

@Service
public class AFKTestService {
    @Autowired
    SQLService sqlService;

    /**
     * 新增服务
     * @param msg
     */
    @ServiceLog("输出示例")
    public void print(String msg) {
        System.out.println(msg);
    }

    /**
     * 新增服务
     * @param sql
     * @param db
     * @return
     * @throws Exception
     */
    @ServiceLog("SQL示例")
    public List<Map<String,Object>> sqlQuery(String sql, JSONObject db) throws Exception{
        return sqlService.execQuery(sql, db);
    }

}
